package model;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.UUID;


/**
 * The persistent class for the ticket database table.
 * 
 */
@Entity
public class Ticket implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int ticketID = Math.abs(UUID.randomUUID().hashCode());

	private BigDecimal price;

	//bi-directional many-to-one association to Schedule
	@ManyToOne
	@JoinColumn(name="ScheduleID")
	private Schedule schedule;

	//bi-directional many-to-one association to Passenger
	@ManyToOne
	@JoinColumn(name="PassengerID")
	private Passenger passenger;

	public Ticket() {
	}

	public int getTicketID() {
		return this.ticketID;
	}

	public void setTicketID(int ticketID) {
		this.ticketID = ticketID;
	}

	public BigDecimal getPrice() {
		return this.price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Schedule getSchedule() {
		return this.schedule;
	}

	public void setSchedule(Schedule schedule) {
		this.schedule = schedule;
	}

	public Passenger getPassenger() {
		return this.passenger;
	}

	public void setPassenger(Passenger passenger) {
		this.passenger = passenger;
	}

}